﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;


namespace ParadiseShophcm.Control
{
    public partial class WUCBinhLuan : System.Web.UI.UserControl
    {
        DataProvider dt = new DataProvider();
        public void LoadBinhLuan()
        {
            //int MaSanPham = int.Parse(Session["MaSanPham"].ToString());
                  int MaSanPham=int.Parse(Request.QueryString["id"].ToString());
            String sql = "SELECT BinhLuan.NoiDung, TaiKhoan.UserName,TaiKhoan.UserID";
                   sql+=" FROM BinhLuan INNER JOIN";
                   sql+=" TaiKhoan ON BinhLuan.UserID = TaiKhoan.UserID";
                   sql+=" WHERE (BinhLuan.MaSanPham = '"+MaSanPham+"')";
            DTLBinhLuan.DataSource=dt.ExecuteQuery(sql,null);
            DTLBinhLuan.DataBind();
            
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                LoadBinhLuan();
            }
        }
    }
}